Inheritance diagram for I3DExGeometricPrimitive:

Public Member Functions | |
| virtual void MCCOMAPI | GetBoundingBox (TBBox3D &bbox)=0 |
| virtual MCCOMErr MCCOMAPI | EnumPatches (EnumPatchesCallback callback, void *privData, boolean &closed)=0 |
| virtual MCCOMErr MCCOMAPI | GetNbrLOD (int16 &nbrLod)=0 |
| virtual MCCOMErr MCCOMAPI | GetLOD (int16 lodIndex, real &lod)=0 |
| virtual MCCOMErr MCCOMAPI | GetFacetMesh (uint32 lodIndex, FacetMesh **outMesh)=0 |
| virtual boolean MCCOMAPI | HasRenderingFacetMesh ()=0 |
| virtual MCCOMErr MCCOMAPI | GetRenderingFacetMesh (FacetMesh **outMesh)=0 |
| virtual void MCCOMAPI | GetRenderingMesh (MeshDataStructure::TMeshList **meshList)=0 |
| virtual boolean MCCOMAPI | CanBeSplit ()=0 |
| virtual MCCOMErr MCCOMAPI | SplitPrimitive (TMCCountedPtrArray< I3DExGeometricPrimitive > &subParts, TMCArray< TTransform3D > &subPartPositions)=0 |
| virtual uint32 MCCOMAPI | GetUVSpaceCount ()=0 |
| virtual MCCOMErr MCCOMAPI | GetUVSpace (uint32 uvSpaceID, UVSpaceInfo *uvSpaceInfo)=0 |
| virtual boolean MCCOMAPI | CanRenameUVSpace ()=0 |
| virtual MCCOMErr MCCOMAPI | RenameUVSpace (uint32 uvSpaceID, const TMCString &name)=0 |
| virtual MCCOMErr MCCOMAPI | UV2XYZ (TVector2 *uv, uint32 uvSpaceID, TVector3 *resultPosition, boolean *inUVSpace)=0 |
| virtual MCCOMErr MCCOMAPI | GetUVSpaceRDS5 (uint32 uvSpaceID, UVSpaceInfoRDS5 *uvSpaceInfoRDS5)=0 |
| virtual MCCOMErr MCCOMAPI | AppendToRenderables (const TTransform3D &worldFromModelTfm, TRenderableAndTfmArray &renderableAndTfm)=0 |
| virtual boolean MCCOMAPI | AutoSwitchToModeler () const =0 |
| virtual boolean MCCOMAPI | IsBBoxPickable () const =0 |
| virtual boolean MCCOMAPI | IsExcludedFromTripleBuffer ()=0 |
| virtual void MCCOMAPI | GetDefaultShader (I3DShShader **shader, TMCString *name=nil)=0 |
| virtual void MCCOMAPI | ChangedData ()=0 |
| virtual MCCOMErr MCCOMAPI | GetWizardPath (TMCString &path)=0 |
| virtual boolean MCCOMAPI | CanConvertToOtherModeler ()=0 |
| virtual void MCCOMAPI | ChangeLocalTimeInHit (RayHitParameters ¶ms)=0 |
| virtual boolean MCCOMAPI | NeedAnimatedShader ()=0 |
| virtual boolean MCCOMAPI | IsGenerator () const =0 |
| virtual I3DShObject *MCCOMAPI | GetPreviewObject (I3DShTreeElement **previewTree)=0 |
In addition to describing geometry, a geometric primitive can define a custom ray-tracing routine rather than relying only on facets or patches. This is done by inheriting from the IRaytracablePrimitive Interface in addition to I3DExGeometricPrimitive (or TBasicPrimitive).
A primitive can also support skinning (skinning is the deformation of the primitive geometry using a skeleton composed of bones). This is done by inheriting from the I3dExSkinable Interface in addition to I3DExGeometricPrimitive (or TBasicPrimitive).
Rather than defining geometry, a primitive can also describe a volume. This is achieved by inheriting from the IVolumePrimitive Interface as well as I3DExGeometricPrimitive (or TBasicPrimitive).
The structure of a primitive is a bit more complex than the average component:
There are 2 COM objects to consider:
For advanced users: You should note that there are actually 3 C++ object (The primitive, the primitive component and the primitive light). However the primitive component and the external primitive are aggregated by COM which means that you can be considered as one single COM object).
To get a pointer to a I3DShExternalPrimitive from a I3DExGeometricPrimitive, you can use the following code:
TMCCountedPtr<I3DShPrimitiveComponent> primitiveComponent;
exPrimitive->QueryInterface(IID_I3DShPrimitiveComponent,(void**)&primitiveComponent);
ThrowIfNil(primitiveComponent);
TMCCountedPtr<I3DShPrimitive> primitive;
primitiveComponent->GetPrimitive(&primitive);
ThrowIfNil(primitive);
TMCCountedPtr<I3DShExternalPrimitive> externalPrimitive;
primitive->QueryInterface(IID_I3DShExternalPrimitive.(void**)&externalPrimitive);
To access I3DExGeometricPrimitive from I3DShPrimitive, you can use the following code:
TMCCountedPtr<I3DShExternalPrimitive> externalPrimitive;
shPrimitive->QueryInterface(IID_I3DShExternalPrimitive.(void**)&externalPrimitive);
ThrowIfNil(externalPrimitive);
TMCCountedPtr<IShComponent> primitiveComponent;
externalPrimitive->GetPrimitiveComponent(&primitiveComponent);
ThrowIfNil(primitiveComponent);
TMCCountedPtr<I3DExGeometricPrimitive> externalPrimitive;
primitiveComponent->QueryInterface(IID_I3DExGeometricPrimitive,(void**)&externalPrimitive);
This code might seem a bit complicated at first but it is actually simple. You have two COM objects that point on each other. I3DShExternalPrimitive::GetPrimitiveComponent() and I3DShPrimitiveComponent::GetPrimitive() allow you to get a pointer from one object to the other. The rest is only calling QueryInterface to get the right interface on each object.
|
||||||||||||
|
Appends the renderable to the renderable array. This is used to append extra renderables on top of the geometry itself.
Implemented in TBasicPrimitive. |
|
|
Returns true if the primitive should be open in its modeler immediately after its insertion Implemented in TBasicPrimitive. |
|
|
Returns true if the primitive can split itself into sub parts of the same type. Implemented in TBasicPrimitive. |
|
|
Returns true if need an apparent button to convert to other modeler. Implemented in TBasicPrimitive. |
|
|
Returns true if the primitive can rename uv spaces (ie. implements RenameUVSpace()). Implemented in TBasicPrimitive. |
|
|
Do not use. Temporary call. Implemented in TBasicPrimitive. |
|
|
Let the object change the local time after a hit
Implemented in TBasicPrimitive. |
|
||||||||||||||||
|
Returns the primitive as a list of bicubic patches. It is recommended to use GetFacetMesh() instead.
Implemented in TBasicPrimitive. |
|
|
Computes the bounding box of the primitive to the 3D Shell. If this call is not implemented the bounding box will be calculated automatically from the patches or facets list. However it is recommended to implement it to speed up the bounding box calculation.
|
|
||||||||||||
|
Returns the default shader for this primitive. This is called each time a primitive is inserted in a scene without a shader
Implemented in TBasicPrimitive. |
|
||||||||||||
|
Returns the Facet Mesh for this lod index.
Implemented in TBasicPrimitive. |
|
||||||||||||
|
Return the floating point value of the level of detail that corresponds to the 0-based 'lodIndex'. (lodIndex=0 means highest resolution)
Implemented in TBasicPrimitive. |
|
|
Returns the number of levels of detail (lod) of the primitive. This value is used to determine the lodIndex in GetLOD().
Implemented in TBasicPrimitive. |
|
|
Return the Master object to preview if different from main one. Return NULL if it is the same,
Implemented in TBasicPrimitive. |
|
|
Returns the mesh that should be used for final rendering. You should only implement this method if you use a mesh for previewing that is different from the the mesh for final rendering.
Implemented in TBasicPrimitive. |
|
|
Returns a pointer to the rendering mesh associated with the primitive. Note that the mesh should not be cached by the primitive so it can be modified by the caller. The mesh can be composed either of triangles or quads. More complexe polygons should be triangulated before the mesh is returned. It is the caller responsability to call release on the mesh once it is not used anymore.
Implemented in TBasicPrimitive. |
|
||||||||||||
|
Returns the information regarding a particular uvSpace (= shading domain).
Implemented in TBasicPrimitive. |
|
|
Returns the number of UV space on the primitives. Implemented in TBasicPrimitive. |
|
||||||||||||
|
Returns the information regarding a particular uvSpace (= shading domain). To be implemented only if your primitive existed in RDS 5 or earlier, so that UV spaces can be mapped properly to the new 0..1 boundaries
Implemented in TBasicPrimitive. |
|
|
Returns the path to the primitive wizard file (wizard.txt) from the application folder.
Implemented in TBasicPrimitive. |
|
|
Returns true if this primitive has a mesh used only for final rendering. If it returns false, you can assume that the mesh for lod 0 and the rendering mesh are the same. Implemented in TBasicPrimitive. |
|
|
Returns true if the primitive can be picked in the 3D View when clicking on its bounding box. Usually, you want to reply no, since the picking is done thru a ray-tracing hit test. However, some primitives such as volumic primitives or particles systems may want to answer yes. Default implementation in TBasicPrimitive returns false. Implemented in TBasicPrimitive. |
|
|
Return true if its instances should be excluded from the triple buffer (eg used for skinning) Implemented in TBasicPrimitive. |
|
|
Return true if the object can generate sub instances if true the component should also implements I3DExInstancePrimitive Implemented in TBasicPrimitive. |
|
|
Return true if the object uses local time and therefore will need animated shader Implemented in TBasicPrimitive. |
|
||||||||||||
|
Rename a particular uvSpace (= shading domain).
Implemented in TBasicPrimitive. |
|
||||||||||||
|
Builds a list of sub-parts of itself. 'subPartPositions' gives the relative position of each sub part in the object local coordinates. Both arrays need to be of same size. Note: the original primitive needs to remain intact.
Implemented in TBasicPrimitive. |
|
||||||||||||||||||||
|
Returns the position in 3D of a point given a set of UV coordinates. This is useful if you want to calculate a UV texture from a 3D shaders for instance.
Implemented in TBasicPrimitive. |
1.4.5